/**
 * Created by Administrator on 2017/8/28.
 */
import  jsonp from 'common/js/jsonp'
import {commonParams, options} from './config.js'

export function getHotKey() {
  const url = 'https://c.y.qq.com/splcloud/fcgi-bin/gethotkey.fcg'
  const data = Object.assign({}, commonParams, {
      platform: 'h5',
      needNewCode: 1
  })
  return jsonp(url, data, options)
}

  export function search(query, page, zhida, perpage) {
    const url = 'https://c.y.qq.com/soso/fcgi-bin/client_search_cp'
    const data = Object.assign({}, commonParams, {
      p: page,
      w: query,
      catZhida: zhida ? 1 : 0,
      t: 0,
      aggr: 1,
      cr: 1,
      lossless: 0,
      prepage: perpage,
      flag_qc: 0,
      notice: 0,
      n: perpage,
      platform: 'yqq',
      needNewCode: 1,
      remoteplace: 'txt.yqq.center',
      uid: 0
    })
    return jsonp(url, data, options)
  }
